import config from "@/config"
import http from "@/utils/request"

export default {
	getMaterialList: {
        lists:{
            url: `${config.API_URL}/adminapi/material.shopMaterialBase/lists`,
            name: "获取物料列表",
            // get: async function(){
            //     return await http.get(this.url);
            // }
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
			url: `${config.API_URL}/adminapi/material.shopMaterialBase/add`,
			name: "添加物料",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        edit: {
			url: `${config.API_URL}/adminapi/material.shopMaterialBase/edit`,
			name: "编辑物料",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        delete: {
			url: `${config.API_URL}/adminapi/material.shopMaterialBase/delete`,
			name: "删除物料",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        update_status: {
			url: `${config.API_URL}/adminapi/material.shopMaterialBase/updateStatus`,
			name: "修改物料状态",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
    getSupplierList: {
        lists:{
            url: `${config.API_URL}/adminapi/material.shopMaterial/lists`,
            name: "获取供应商物料列表",
            get: async function(data={}){
				return await http.get(this.url, data);
			}
        },
        add: {
			url: `${config.API_URL}/adminapi/material.shopMaterial/add`,
			name: "添加供应商物料",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        edit: {
			url: `${config.API_URL}/adminapi/material.shopMaterial/edit`,
			name: "编辑供应商物料",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        delete: {
			url: `${config.API_URL}/adminapi/material.shopMaterial/delete`,
			name: "删除供应商物料",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        update_status: {
			url: `${config.API_URL}/adminapi/material.shopMaterial/updateStatus`,
			name: "修改供应商物料状态",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
        detail: {
			url: `${config.API_URL}/adminapi/material.shopMaterial/detail`,
			name: "获取供应商物料详情",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
	},
    getSKU:{
        url: `${config.API_URL}/adminapi/material.shopMaterial/getLastSku`,
        name: "获取物料编号",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
    getMaterialPurchaseOrder: {
        lists:{
            url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/lists`,
            name: "获取物料采购列表",
            // get: async function(){
            //     return await http.get(this.url);
            // }
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
			url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/add`,
			name: "添加采购单",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        edit: {
			url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/edit`,
			name: "编辑采购单",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        delete: {
			url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/delete`,
			name: "删除采购单",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        detail: {
            url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/detail`,
            name: "获取采购单详情",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        examine: {
			url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/examine`,
			name: "采购单审核",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        editQuantity: {
			url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/editQuantity`,
			name: "采购单确认入库",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        createBill: {
			url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/createBill`,
			name: "生成结算单",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
    getshopCar:{
        lists:{
            url: `${config.API_URL}/adminapi/material.shopMaterialNeedPlanning/lists`,
            name: "物料购物车列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
			url: `${config.API_URL}/adminapi/material.shopMaterialNeedPlanning/add`,
			name: "购物车新增订单",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        pushOrder: {
			url: `${config.API_URL}/adminapi/material.shopMaterialNeedPlanning/createPurchaseOrder`,
			name: "购物车批量下单",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        edit:{
            url: `${config.API_URL}/adminapi/material.shopMaterialNeedPlanning/edit`,
            name: "列表的购物车数量",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
			url: `${config.API_URL}/adminapi/material.shopMaterialNeedPlanning/delete`,
			name: "购物车删除",
			post: async function(data={}){
				return await http.post(this.url, data);
			}
		},
        listsOfSupplier:{
            url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/listsOfSupplier`,
            name: "本厂采购单列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
    },
    factory:{
        send: {
            url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/sendMaterial`,
            name: "供应商发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        retSend: {
            url: `${config.API_URL}/adminapi/material.shopMaterialPurchaseOrder/returnMaterial`,
            name: "采购单退货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
    },
    qrcode:{
        url: `${config.API_URL}/adminapi/material.shopMaterial/qrcodeList`,
        name: "物料二维码",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
}
